import request from '@/utils/request';

export async function getGoods(params) {
  return request('/admin/goods', { params });
}

export async function switchGoodStatus(id) {
  return request.patch(`/admin/goods/${id}/on`);
}

export async function switchGoodRecommend(id) {
  return request.patch(`/admin/goods/${id}/recommend`);
}

export async function getGoodCategory() {
  return request('/admin/category');
}

export async function getOssToken() {
  return request('/auth/oss/token');
}

export async function addGood(params) {
  return request.post('/admin/goods', { params });
}

export async function getOrders(params) {
  return request('/admin/orders', { params });
}
